<#macro categoryTree parentId=''>
    <@_categoryList advanced=true parentId=parentId>
        <#list page.list as a>
            <li>
                <a href="javascript:;" onclick="$('input[name=categoryId]',$.pdialog.getCurrent()).val('${a.id}');$('form',$.pdialog.getCurrent()).submit();" target="ajax">${a.name!}</a>
            <#if a.childIds?has_content>
                <ul>
                    <@categoryTree a.id/>
                </ul>
            </#if>
            </li>
        <#else>
            <li><a>空目录</a></li>
        </#list>
    </@_categoryList>
</#macro>
<script>
$('.pageContent table tbody tr input[name=ids]',navTab.getCurrentPanel()).each(function(){
    if($(this).is(":checked")){
        $('<input type="hidden" name="ids" value="'+$(this).val()+'"/>').appendTo($('#idsToMove',$.pdialog.getCurrent()));
    }
});
if(0==$('#idsToMove input',$.pdialog.getCurrent()).length){
    alertMsg.error('请选择内容');
    $.pdialog.closeCurrent();
}
</script>
<div class="pageContent">
    <form action="cmsContent/move.do?callbackType=closeCurrent" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
        <input type="hidden" name="categoryId" value=""/>
        <div id="idsToMove"></div>
        <div class="formBar">
            <ul>
                <li><button type="button" class="button close">关闭</button></li>
            </ul>
        </div>
        <div class="pageFormContent" layoutH="60">
            <ul class="tree treeFolder expand">
                <li>
                    <a href="javascript:;" onclick="return false;">请选择父分类</a>
                    <ul><@categoryTree/></ul>
                </li>
            </ul>
        </div>
    </form>
</div>